<html>
<head><meta charset="utf-8"><title>stacked borrows: Box with a unique tag · t-lang/wg-unsafe-code-guidelines · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/index.html">t-lang/wg-unsafe-code-guidelines</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/stacked.20borrows.3A.20Box.20with.20a.20unique.20tag.html">stacked borrows: Box with a unique tag</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="148098215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/stacked%20borrows%3A%20Box%20with%20a%20unique%20tag/near/148098215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/stacked.20borrows.3A.20Box.20with.20a.20unique.20tag.html#148098215">(Nov 21 2018 at 09:30)</a>:</h4>
<p>So I made <code>Box</code> be treated like <code>&amp;mut</code>, exploiting that it is a lang item. That gives us some nice extra guarantees. However, how I am having trouble with <code>Box::into_unique</code>... I somehow need to erase the tag <em>and</em> trigger and <code>EscapeToRaw</code>, and that is not trivial :/ I mean I could always use <code>transmute</code>, but that does not seem nice.<br>
Cc <span class="user-mention" data-user-id="116009">@nikomatsakis</span> <span class="user-mention" data-user-id="137587">@Gankro</span></p>



<a name="148107106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/stacked%20borrows%3A%20Box%20with%20a%20unique%20tag/near/148107106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/stacked.20borrows.3A.20Box.20with.20a.20unique.20tag.html#148107106">(Nov 21 2018 at 12:37)</a>:</h4>
<p>Ah, I found a way</p>



<a name="148108088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/stacked%20borrows%3A%20Box%20with%20a%20unique%20tag/near/148108088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/stacked.20borrows.3A.20Box.20with.20a.20unique.20tag.html#148108088">(Nov 21 2018 at 12:58)</a>:</h4>
<p>See <a href="https://github.com/rust-lang/rust/issues/56133" target="_blank" title="https://github.com/rust-lang/rust/issues/56133">#56133</a></p>



<a name="148112650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/stacked%20borrows%3A%20Box%20with%20a%20unique%20tag/near/148112650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/stacked.20borrows.3A.20Box.20with.20a.20unique.20tag.html#148112650">(Nov 21 2018 at 14:20)</a>:</h4>
<p>actually... I don't even want barriers for boxes. then things pass without that PR, though I have to make sure I understand why.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>